#include "Objects.h"

Objects::Objects()
{
    _pos_x = 0;
    _pos_y = 0;

    _direction_x = 0;
    _direction_y = 0;

    _bound_x = 0;
    _bound_y = 0;

    _alive = true;
    _collidable = true;

    _image = NULL;

}

void Objects::initialise(int pos_x, int pos_y, int direction_x, int direction_y, float speed_x, float speed_y, int bound_x, int bound_y)
{
    _pos_x = pos_x;
    _pos_y = pos_y;
    _direction_x = direction_x;
    _direction_y = direction_y;
    _speed_x = speed_x;
    _speed_y = speed_y;
    _bound_x = bound_x;
    _bound_y = bound_y;

}

void Objects::destroy()
{
    if(_image != NULL)
    {
        al_destroy_bitmap(_image);
    }
}

void Objects::update()
{
    _pos_x += _speed_x * _direction_x;
    _pos_y += _speed_y * _direction_y;
}

void Objects::render()
{
    //empty for now
}

void Objects::check_collision(Objects *collided_object)
{
    //see end of tut 2
}

void Objects::collided(int object_ID)
{

}

bool Objects::collidable()
{
    //returns true only if both _alive and _collidable are true
    return _alive && _collidable;
}


Objects::~Objects()
{
    //dtor
}
